var express = require('express');
var router = express.Router();

var proinfoDAO = require("../bin/proinfoDAO.js");

var fs = require("fs");

// var multer = require("multer");
// var storage = multer.diskStorage({
//   destination: function (req, file, cb) {
//     cb(null, './public/img/goods');
//   },
//   filename: function (req, file, cb) {
//     var suffix = file.mimetype.split("/")[1];
//     var filename = file.fieldname + '-' + Date.now()+"."+suffix;
//     imgs.push(filename);
//     cb(null, filename);
//   }
// })
// var upload = multer({ storage: storage });


// 根据id查商品详情
router.get("/proinfo",(req,res)=>{
    proinfoDAO.findOne(req.query)
    .then(data=>{
        res.json({err:0,data:data});
    });
});


module.exports = router;